package pl.lsierant.j2me.bipacz.notifications.impl;

import javax.microedition.lcdui.Display;

import pl.lsierant.j2me.bipacz.BipaczMidlet;

public class NotificationManager {
    private static final NotificationManager instance = new NotificationManager();

    // singleton
    private NotificationManager() {
    }

    public static NotificationManager getInstance() {
        return instance;
    }

    public synchronized void run(BeepNotification notification) {
        BipaczMidlet.getInstance().getPlayerManager().playBeep1();
    }

    public synchronized void run(DefaultNotification notification) {
        // FIXME default notification from settings
        BipaczMidlet.getInstance().getPlayerManager().playBeep1();
    }

    public synchronized void run(FlashNotification notification) {
        Display.getDisplay(BipaczMidlet.getInstance()).flashBacklight(notification.getDuration());
    }

    public synchronized void run(VibrateNotification notification) {
        Display.getDisplay(BipaczMidlet.getInstance()).vibrate(notification.getDuration());
    }
}
